CC?=gcc
INSTALL=install
FIND=find
+PERL=perl
# compiler settings
CFLAGS ?= -O2
$(CC) $(UCFLAGS) $(LDFLAGS) test/custom.c test/tests.o utf8proc.o -o $@
test/misc: test/misc.c test/tests.o utf8proc.o utf8proc.h test/tests.h
- $(CC) $(UCFLAGS) $(LDFLAGS) test/misc.c test/tests.o utf8proc.o -o $@
+ $(CC) $(UCFLAGS) $(LDFLAGS) -DUNICODE_VERSION='"'`$(PERL) -ne "/^UNICODE_VERSION=/ and print $$';" data/Makefile`'"' test/misc.c test/tests.o utf8proc.o -o $@
check: test/normtest data/NormalizationTest.txt test/graphemetest data/GraphemeBreakTest.txt test/printproperty test/case test/custom test/charwidth test/misc test/valid test/iterate bench/bench.c bench/util.c bench/util.h utf8proc.o
$(MAKE) -C bench
CharWidths.txt: charwidths.jl EastAsianWidth.txt
$(JULIA) charwidths.jl > $@
-# Unicode data version
+# Unicode data version (must also update utf8proc_unicode_version function)
UNICODE_VERSION=12.0.0
UnicodeData.txt:
{
issue128();
issue102();
+#ifdef UNICODE_VERSION
+ printf("Unicode version: Makefile has %s, has API %s\n", UNICODE_VERSION, utf8proc_unicode_version());
+ check(!strcmp(UNICODE_VERSION, utf8proc_unicode_version()), "utf8proc_unicode_version mismatch");
+#endif
printf("Misc tests SUCCEEDED.\n");
return 0;
}
return STRINGIZE(UTF8PROC_VERSION_MAJOR) "." STRINGIZE(UTF8PROC_VERSION_MINOR) "." STRINGIZE(UTF8PROC_VERSION_PATCH) "";
}
+UTF8PROC_DLLEXPORT const char *utf8proc_unicode_version(void) {
+ return "12.0.0";
+}
+
UTF8PROC_DLLEXPORT const char *utf8proc_errmsg(utf8proc_ssize_t errcode) {
switch (errcode) {
case UTF8PROC_ERROR_NOMEM:
*/
UTF8PROC_DLLEXPORT const char *utf8proc_version(void);
+/**
+ * Returns the utf8proc supported Unicode version as a string MAJOR.MINOR.PATCH.
+ */
+UTF8PROC_DLLEXPORT const char *utf8proc_unicode_version(void);
+
/**
* Returns an informative error string for the given utf8proc error code
* (e.g. the error codes returned by @ref utf8proc_map).